package com.chinasofti.io;


import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class Demo06 {
    public static void main(String[] args) throws IOException {
        //找不到文件抛出异常FileNotFoundException
        FileInputStream fis = new FileInputStream("D:\\aaa\\超级玛丽.jpg");
//        int  by;
        byte[] by = new byte[1024];
        int len;
//        fis.read();//读取
        //by == -1;没数据
        FileOutputStream fileOutputStream = new FileOutputStream("java0419\\超级玛丽.jpg");
        while ((len = fis.read(by)) != -1){
            //将字节写入文件输出流
            fileOutputStream.write(by,0,len);
        }
        fis.close();
        fileOutputStream.close();
    }
}
